package com.example.app.components.MyEmptyShow

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.AssignmentLate
import androidx.compose.material.icons.rounded.Upcoming
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.example.app.components.MyIcon.MyIcon
import com.example.app.components.MySpacer.MySpacer
import com.example.app.components.MyText.MyText
import com.example.app.ui.theme.my_description_color
import com.example.app.ui.theme.my_no_data_bg

@Composable
fun MyEmptyShow(
        marginTopDp: Dp = 150.dp,
        iconSize: Dp = 150.dp,
        icon: @Composable () -> Unit = {
            MyIcon(
                imageVector = Icons.Rounded.AssignmentLate,
                tint = my_no_data_bg,
                modifier = Modifier.size(iconSize)
            )
        },
        description: @Composable () -> Unit = {
            MyText(
                text = "没有数据",
                color = my_description_color
            )
        }
) {
    Box(
        contentAlignment = Alignment.TopCenter,
        modifier = Modifier.fillMaxSize()
    ) {
        Column(
            modifier = Modifier.fillMaxWidth(),
            horizontalAlignment = Alignment.CenterHorizontally,
            verticalArrangement = Arrangement.Center
        ) {
            MySpacer(modifier = Modifier.height(marginTopDp))
            MyIcon(
                imageVector = Icons.Rounded.Upcoming,
                tint = my_no_data_bg,
                modifier = Modifier.size(150.dp)
            )
            MySpacer(modifier = Modifier.height(12.dp))
            MyText(
                text = "没有数据",
                color = my_description_color
            )
        }
    }
}